package com.xbongbong.paas.service;

import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt;
import com.xbongbong.paas.elasticsearch.pojo.dto.SearchBoardConditionDTO;
import com.xbongbong.paas.elasticsearch.pojo.dto.SearchDataInConditionDTO;
import com.xbongbong.paas.elasticsearch.pojo.dto.SearchDataSetInConditionDTO;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.BusinessRulesPoJo;
import com.xbongbong.paas.pojo.dto.BusinessFormDataDTO;
import com.xbongbong.paas.pojo.dto.FormDataDeleteBatchDTO;
import com.xbongbong.paas.pojo.dto.FormDataListDTO;
import com.xbongbong.paas.pojo.dto.FormDataUpdateBatchDTO;
import com.xbongbong.paas.pojo.dto.SearchInConditionDTO;
import com.xbongbong.paas.pojo.vo.FormDataDeleteBatchVO;
import com.xbongbong.paas.pojo.vo.LinkFormDataVO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsListVO;
import com.xbongbong.paas.pojo.vo.SearchDataInConditionVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.businessdata.pojo.dto.SpecificationHistoryDTO;
import com.xbongbong.pro.businessdata.pojo.vo.SpecificationHistoryVO;
import com.xbongbong.pro.form.pojo.dto.EsDataDTO;
import com.xbongbong.pro.formdata.pojo.dto.FieldExistDataDTO;
import com.xbongbong.pro.formdata.pojo.dto.SpecificationDTO;
import com.xbongbong.pro.formdata.pojo.vo.FieldExistDataVO;
import com.xbongbong.pro.formdata.pojo.vo.OtherDataListVO;
import com.xbongbong.pro.weblist.pojo.dto.SaasBaseDTO;
import com.xbongbong.pro.weblist.pojo.vo.WaitNumberVO;

import java.util.List;
import java.util.Map;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/7/4 10:40
 * @since v1.0
 */
public interface ProFormDataService {



    /**
     * 检验能否不可见或不启用规格字段
     * @param specificationDTO
     * @return
     * @throws XbbException
     */
    FieldExistDataVO canDeleteSpecification(SpecificationDTO specificationDTO) throws XbbException;

    /**
     * 批量更新
     * @param formDataUpdateBatchDTO
     * @param paasFormEntityExt
     * @throws XbbException
     */
    void updateBatch(FormDataUpdateBatchDTO formDataUpdateBatchDTO, PaasFormEntityExt paasFormEntityExt, Map<String, FieldAttrEntity> explainMap) throws XbbException;

    /**
     * 批量删除
     * @param formDataDeleteBatchDTO
     * @param businessRules
     * @return
     * @throws XbbException
     */
    FormDataDeleteBatchVO deleteBatch(FormDataDeleteBatchDTO formDataDeleteBatchDTO, List<BusinessRulesPoJo> businessRules) throws XbbException;

    WaitNumberVO waitNumber(SaasBaseDTO saasBaseDTO) throws XbbException;

    SpecificationHistoryVO specificationHistory(SpecificationHistoryDTO specificationHistoryDTO) throws XbbException;

    /**
     * 列表上的筛选项
     * @param searchDataInConditionDTO
     * @return
     * @throws XbbException
     */
    SearchDataInConditionVO dataConditionList(SearchDataInConditionDTO searchDataInConditionDTO) throws XbbException;

    /**
     * 组织架构等通用筛选
     * @param searchInConditionDTO
     * @return com.xbongbong.paas.pojo.vo.SearchDataInConditionVO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    SearchDataInConditionVO organizationConditionList(SearchInConditionDTO searchInConditionDTO) throws XbbException;

    /**
     * 市场活动详情页tab：关联销售线索，列表上的筛选项
     * @param searchDataInConditionDTO
     * @return
     * @throws XbbException
     */
    SearchDataInConditionVO relClueDataConditionList(SearchDataInConditionDTO searchDataInConditionDTO) throws XbbException;

    /**
     * 获取其他数据列表
     * @param otherDataListDTO
     * @return
     * @throws XbbException
     */
    OtherDataListVO otherDataList(FormDataListDTO otherDataListDTO) throws XbbException;

    /**
     * 下拉框-搜索工商查询
     * @param businessFormDataDTO
     * @return
     */
    LinkFormDataVO businessComboData(BusinessFormDataDTO businessFormDataDTO) throws XbbException;
    /**
     * 根据id查询主数据和子表单数据
     * @param corpid
     * @param saasMark
     * @param businessType
     * @param formId
     * @param dataIdList
     * @return java.util.List<com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt>
     * @author 吴峰
     * @date 2020/10/14 10:22
     * @throws XbbException
     */
    List<PaasFormDataEntityExt> dataListAndSubDataList(String corpid, Integer saasMark, Integer businessType,
                                                       Long formId, List<Long> dataIdList) throws XbbException;
    /**
     * @param list
     * @param corpid
     * @param saasMark
     * @param businessType
     * @param formId
     * @return void
     * @author 吴峰
     * @date 2020/10/15 11:35
     * @throws XbbException       
     */
    void setSubFormData(List<PaasFormDataEntityExt> list, String corpid, Integer saasMark, Integer businessType, Long formId) throws XbbException;

    /**
     * 数据集下拉筛选选项
     * @param searchDataSetInConditionDTO
     * @throws XbbException
     * @return
     */
    SearchDataInConditionVO dataSetConditionList(SearchDataSetInConditionDTO searchDataSetInConditionDTO)  throws XbbException;

    /**
     * 数据集(画布)下拉筛选选项
     * @param searchBoardConditionDTO
     * @return
     * @throws XbbException
     */
    SearchDataInConditionVO dataSetConditionList(SearchBoardConditionDTO searchBoardConditionDTO)  throws XbbException; 
}
